using System;

namespace Altova.TypeInfo
{
	public class TypeInfo
	{
		private int namespaceIndex;

		private int baseTypeIndex;

		private InfoBinderInterface binder;

		private ValueFormatter formatter;

		public string localName;

		public int memberBegin;

		public int memberEnd;

		public FacetInfo[] facets;

		public WhitespaceType whitespace;

		public MemberInfo[] Members
		{
			get
			{
				MemberInfo[] array = new MemberInfo[memberEnd - memberBegin];
				Array.Copy(binder.Members, memberBegin, array, 0, array.Length);
				return array;
			}
		}

		public NamespaceInfo Namespace
		{
			get
			{
				return binder.Namespaces[namespaceIndex];
			}
		}

		public TypeInfo BaseType
		{
			get
			{
				return binder.Types[baseTypeIndex];
			}
		}

		public ValueFormatter Formatter
		{
			get
			{
				return formatter;
			}
		}

		public TypeInfo(InfoBinderInterface binder, int namespaceIndex, string localName, int baseTypeIndex, int memberBegin, int memberEnd, FacetInfo[] facets, WhitespaceType whitespace, ValueFormatter frmatter)
		{
			this.namespaceIndex = namespaceIndex;
			this.localName = localName;
			this.baseTypeIndex = baseTypeIndex;
			this.memberBegin = memberBegin;
			this.memberEnd = memberEnd;
			this.facets = facets;
			this.whitespace = whitespace;
			this.binder = binder;
			formatter = frmatter;
		}

		public TypeInfo(InfoBinderInterface binder, int namespaceIndex, string localName, int baseTypeIndex, int memberBegin, int memberEnd, FacetInfo[] facets, WhitespaceType whitespace)
		{
			this.namespaceIndex = namespaceIndex;
			this.localName = localName;
			this.baseTypeIndex = baseTypeIndex;
			this.memberBegin = memberBegin;
			this.memberEnd = memberEnd;
			this.facets = facets;
			this.whitespace = whitespace;
			this.binder = binder;
			formatter = null;
		}
	}
}
